Skip to content

fix: markdown rendering for custom types#483

Open
sharanyavinod wants to merge 9 commits into
mainfrom
ew-md
Open

fix: markdown rendering for custom types#483
sharanyavinod wants to merge 9 commits into
mainfrom
ew-md

Conversation

@sharanyavinod
Copy link
Copy Markdown
Contributor

Preview at https://da.live/canvas?nx=ew-md&nxver=2#/exp-workspace/frescopa/index

@aem-code-sync
Copy link
Copy Markdown

aem-code-sync Bot commented May 29, 2026

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-sync branch
Commits

Comment thread nx2/blocks/chat/renderers.js
Comment thread nx2/blocks/chat/chat.css Outdated
Comment thread nx2/blocks/chat/chat.css Outdated
Comment thread nx2/blocks/chat/renderers.js Outdated
@hannessolo
Copy link
Copy Markdown
Contributor

Nice, looks much better!

I'm fine with the current implementation for now, but as an improvement we should find a way to already render the correct style before the closing tag appears.

@sharanyavinod
Copy link
Copy Markdown
Contributor Author

we should find a way to already render the correct style before the closing tag appears

Done :)

Comment thread nx2/blocks/chat/chat.css
position: absolute;
inset: 0;
background-color: currentcolor;
mask-image: url("https://da.live/img/icons/s2-icon-checkmark-20-n.svg");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we set the URL via a JS custom property (--checkmark-icon: url(${...})) using codeBase, the same way inline SVG refs are handled instead of hardcoding the CDN url?

Copy link
Copy Markdown
Contributor Author

@sharanyavinod sharanyavinod Jun 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, but mask-image on a pseudo-element is purely decorative styling with no functional JS dependency. Adding a custom property would couple js and css just to avoid a stable CDN URL and the trade-off didnt feel worth it here.

const IMAGE_EXTS = new Set(['png', 'jpg', 'jpeg', 'gif', 'webp', 'svg', 'mp4', 'webm', 'mov']);
const TABLE_EXTS = new Set(['json', 'xlsx', 'xls', 'csv']);

export function fileIconName(filename) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the old code had a comment saying this mirrors entryTypeFromExtension in browse/utils.js. we removed the comment but the duplication is still there. why not move fileIconName to nx2/utils/ and delete browse/utils.js's version, or at least import from there? two parallel implementations will diverge.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Browse doesnt exist anymore - the comment is a remnant from when we had custom browse block similar to chat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants